# coding=utf-8
import arcpy
import F

path = r'D:\WorkData\20250712四川河流\shp\分县'.decode('utf-8')

shps = F.listFiles(path,'','x')

for shp in shps:
    arcpy.AddField_management(shp,'city','TEXT')
    city = shp.split('\\')[-1].split('.')[0].encode('utf-8')
    arcpy.CalculateField_management(shp, 'city','"{}"'.format(city))
    print shp.split('\\')[-1].split('.')[0]